import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ParkCustomerServiceVO, ParkCustomerServiceForm, ParkCustomerServiceQuery } from '@/api/park/parkCustomerService/types';

/**
 * 查询客服列表
 * @param query
 * @returns {*}
 */

export const listParkCustomerService = (query?: ParkCustomerServiceQuery): AxiosPromise<ParkCustomerServiceVO[]> => {
  return request({
    url: '/park/parkCustomerService/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询客服详细
 * @param id
 */
export const getParkCustomerService = (id: string | number): AxiosPromise<ParkCustomerServiceVO> => {
  return request({
    url: '/park/parkCustomerService/' + id,
    method: 'get'
  });
};

/**
 * 新增客服
 * @param data
 */
export const addParkCustomerService = (data: ParkCustomerServiceForm) => {
  return request({
    url: '/park/parkCustomerService',
    method: 'post',
    data: data
  });
};

/**
 * 修改客服
 * @param data
 */
export const updateParkCustomerService = (data: ParkCustomerServiceForm) => {
  return request({
    url: '/park/parkCustomerService',
    method: 'put',
    data: data
  });
};

/**
 * 删除客服
 * @param id
 */
export const delParkCustomerService = (id: string | number | Array<string | number>) => {
  return request({
    url: '/park/parkCustomerService/' + id,
    method: 'delete'
  });
};
